package com.bdqn.ch06.service;

import com.bdqn.ch06.entity.Role;
import com.bdqn.ch06.repository.RoleRepository;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class RoleServiceImp implements RoleService {

    @Resource
    RoleRepository roleRepository;

    @Override
    public List<Role> getRoleListService() {
        Sort sort = new Sort(Sort.Direction.ASC, "roleId");
        return roleRepository.findAll(sort);
    }
}
